#pragma once
#include "DXAMLCommon.h"
#include "XamlContext.h"
#include "XamlParserStack.h"
#include "XamlParserFrame.h"

class XamlSchemaContext;
class XamlParserStack;
class XamlNamespace;
//class XamlProperty;


class XamlParserContext : 
	public XamlContext
{

private: 
	XamlParserStack m_ParserStack;
	xshared_ptr<xstringmap<xshared_ptr<XamlNamespace> > > m_PrescopeNamespaces;
	xstringmap<XUINT32> m_IgnoredNamespaceUris;


private: 
	XamlParserContext(const xshared_ptr<XamlSchemaContext> & inSchemaContext);

public: 
	static HRESULT Create(const xshared_ptr<XamlSchemaContext> & inSchemaContext, xshared_ptr<XamlParserContext> & outParserContext);
	virtual HRESULT AddNamespacePrefix(const xshared_ptr<CXString> & inPrefix, const xshared_ptr<XamlNamespace> & inXamlNamespace);
	virtual HRESULT FindNamespaceByPrefix(const xshared_ptr<CXString> & inPrefix, xshared_ptr<XamlNamespace> & outNamespace);
	virtual HRESULT AddIgnoredUri(const xshared_ptr<CXString> & inUriToIgnore);
	virtual HRESULT IsNamespaceUriIgnored(const xshared_ptr<CXString> & inUriToIgnore, XBOOL & bIsIgnored);
	HRESULT PushScope(XBOOL fPushNamescopes);
	HRESULT PushScope();
	HRESULT PopScope();
	XBOOL IsStackEmpty();
	enum XamlParserFrame::ElementKind get_CurrentKind();
	void set_CurrentKind(const enum XamlParserFrame::ElementKind & inCurrentKind);
	XBOOL get_CurrentInPropertyElement();
	void set_CurrentInPropertyElement(const XBOOL & bCurrentInPropertyElement);
	XBOOL get_ParentIsPropertyElement();
	void set_ParentIsPropertyElement(const XBOOL & bParentIsPropertyElement);
	const xshared_ptr<XamlType> & get_CurrentType();
	void set_CurrentType(const xshared_ptr<XamlType> & inCurrentType);
	XBOOL get_CurrentSeenRealProperties();
	void set_CurrentSeenRealProperties(const XBOOL & bSeenRealProperties);
	const xshared_ptr<XamlType> & get_CurrentPreviousChildType();
	void set_CurrentPreviousChildType(const xshared_ptr<XamlType> & inCurrentPreviousChildType);
	XBOOL get_CurrentInItemsProperty();
	void set_CurrentInItemsProperty(const XBOOL & bCurrentInItemsProperty);
	const xshared_ptr<XamlProperty> & get_CurrentMember();
	void set_CurrentMember(const xshared_ptr<XamlProperty> & inCurrentMember);
	XBOOL get_CurrentInInitProperty();
	void set_CurrentInInitProperty(const XBOOL & bCurrentInInitProperty);
	XBOOL get_CurrentInUnknownContent();
	void set_CurrentInUnknownContent(XBOOL bCurrentInUnknownContent);
	XBOOL get_CurrentInCollectionFromMember();
	void set_CurrentInCollectionFromMember(const XBOOL & bCurrentInCollectionFromMember);
	XBOOL get_CurrentInImplicitContent();
	void set_CurrentInImplicitContent(const XBOOL & bCurrentInImplicitContent);
};


